\documentclass{assign}
\def\func{ x 3 exp x y 4 exp mul add x 5 div sub 10 mul
  2.729 x dup mul y dup mul add neg exp mul
  2.729 x 1.225 sub dup mul y dup mul add neg exp add }
\def\assignImage{\begin{pspicture}(-6,-3)(6,4)
  \psset{Alpha=45,Beta=15}
  \psplotThreeD[plotstyle=curve,yPlotpoints=50,xPlotpoints=80,
     linewidth=0.5pt](-4,4)(-4,4){\func}
  \pstThreeDCoor[xMax=5,yMax=5,zMax=3.5]
\end{pspicture}
}
\title{MATH235}
\unitname{Mathematics IIA}
\subtitle{Solution To Assignment 1}
\author{Vafa \underline{Khalighi}}
\sid{41206312}
\acknowledgmenttext{This assignment is typeset using \LaTeX\ document preparation system  and all the graphics are produced by PSTricks and TIKZ packages. This assignment is all my own work and wherever I have used other people's work, I have acknowledged that in the bibliography at the end of this document.}
\begin{document}
\maketitle
\acknowledgment

\vfill
\begin{center}
\begin{tikzpicture}
\node [acknowledgmentbox] (box){%
    \begin{minipage}{0.8\textwidth}
Plagiarism involves using the work of another person and presenting it as one's
own. For this assignment, the following acts constitute plagiarism:
\begin{enumerate}[a)]
\item Copying or summarizing another person's work.
\item Where there was collaborative preparatory work, submitting substantially the same final
version of any material as another student.
\end{enumerate}
    \end{minipage}
};
\node[acknowledgmenttitle, right=10pt] at (box.north west) {PLAGIARISM};
\end{tikzpicture}%
\end{center}

\vfill
\begin{itemize}
\item I have read the definition of plagiarism that appears above.
\item In my assignment I have carefully acknowledged the source of any material which is not my
own work.
\item I am aware that the penalties for plagiarism can be very severe.
\item If I have discussed the assignment with another student, I have written the solutions independently.
\end{itemize}

 \medskip
 \begin{center}
 	\begin{tikzpicture}[decoration=snake,color=Orange,line width=1pt]
 	  \draw[decorate] (0,0)--(\textwidth-1cm,0);
 	\end{tikzpicture}
 \end{center}
\clearpage
\tableofcontents
\listoffigures
\section{Algebra}

\subsection{Question 1}
\subsubsection{Part (a)}
\begin{align}
P(x)&=a_0+a_1x+a_2x^2+a_3x^3\label{eqa1}\\
P(x_i)&=y_i\quad\text{for each }i=1,2,3,4\label{eqa2}
\end{align}
For $i=1$, we have $(x_1,y_1)=(1,2.5)$ so we should have $P(x_1)=y_1$  from equation \eqref{eqa2}. We then substitute the values of $x_1$ and $y_1$ into equation \eqref{eqa1} to obtain:
\begin{equation}
a_0+a_1+a_2+a_3=2.5\label{eqa3}
\end{equation}
For $i=2$, we have $(x_2,y_2)=(2,3)$ so we should have $P(x_2)=y_2$  from equation \eqref{eqa2}. We then substitute the values of $x_2$ and $y_2$ into equation \eqref{eqa1} to obtain:
\begin{equation}
a_0+2a_1+4a_2+8a_3=3\label{eqa4}
\end{equation}
For $i=3$, we have $(x_3,y_3)=(3,5.5)$ so we should have $P(x_3)=y_3$  from equation \eqref{eqa2}. We then substitute the values of $x_3$ and $y_3$ into equation \eqref{eqa1} to obtain:
\begin{equation}
a_0+3a_1+9a_2+27a_3=5.5\label{eqa5}
\end{equation}
For $i=4$, we have $(x_4,y_4)=(4,13)$ so we should have $P(x_4)=y_4$  from equation \eqref{eqa2}. We then substitute the values of $x_4$ and $y_4$ into equation \eqref{eqa1} to obtain:
\begin{equation}
a_0+4a_1+16a_2+64a_3=13\label{eqa6}
\end{equation}
We obtain four equations :\eqref{eqa3}, \eqref{eqa4}, \eqref{eqa5} and \eqref{eqa6}. Yes, the equations are linear.
\subsubsection{Part (b)}
\begin{align*}
\left[\begin{array}{cccc|c}
1&1&1&1&2.5\\
1&2&4&8&3\\
1&3&9&27&5.5\\
1&4&16&64&13
\end{array}\right]
&\equiv
\left[\begin{array}{cccc|c}
1&1&1&1&2.5\\
0&-1&-3&-7&-0.5\\
0&2&8&26&3\\
0&3&15&63&10.5
\end{array}\right]
\begin{array}{l}
R_1\\R_1-R_2\\-R_1+R_3\\-R_1+R_4
\end{array}\\
&\equiv
\left[\begin{array}{cccc|c}
1&1&1&1&2.5\\
0&-1&-3&-7&-0.5\\
0&1&4&13&1.5\\
0&1&5&21&3.5
\end{array}\right]
\begin{array}{l}
R_1\\R_2\\\frac{1}{2}R_3\\\frac{1}{3}R_4
\end{array}\\
&\equiv
\left[\begin{array}{cccc|c}
1&0&-2&-6&2\\
0&-1&-3&-7&-0.5\\
0&0&1&6&1\\
0&0&2&14&3
\end{array}\right]\begin{array}{l}
R_1+R_2\\R_2\\R_2+R_3\\R_2+R_4
\end{array}\\
&\equiv
\left[\begin{array}{cccc|c}
1&0&0&6&4\\
0&-1&0&11&2.5\\
0&0&1&6&1\\
0&0&0&-2&-1
\end{array}\right]\begin{array}{l}
2R_3+R_1\\3R_3+R_2\\R_3\\2R_3-R_4
\end{array}\\
&\equiv
\left[\begin{array}{cccc|c}
1&0&0&0&1\\
0&-2&0&0&-6\\
0&0&1&0&-2\\
0&0&0&-2&-1
\end{array}\right]\begin{array}{l}
3R_4+R_1\\11R_4+2R_2\\3R_4+R_3\\R_4
\end{array}\\
&\equiv
\left[\begin{array}{cccc|c}
1&0&0&0&1\\
0&1&0&0&3\\
0&0&1&0&-2\\
0&0&0&1&\frac{1}{2}
\end{array}\right]\begin{array}{l}
R_1\\-\frac{1}{2}R_2\\R_3\\-\frac{1}{2}R_4
\end{array}\\
&\therefore\begin{cases}
a_0=1\\a_1=3\\a_2=-2\\a_3=\frac{1}{2}
\end{cases}
\end{align*}
\subsection{Question 2}
\subsubsection{Part (a)}
\[\left[\begin{array}{ccc|c}
1&-2&1&3\\
-1&-2&1&-3\\
2&0&0&3
\end{array}\right]\]
\subsubsection{Part (b)}
\begin{align}
\left[\begin{array}{ccc|c}
1&-2&1&3\\
-1&-2&1&-3\\
2&0&0&3
\end{array}\right]&\equiv
\left[\begin{array}{ccc|c}
2&0&0&3\\
-1&-2&1&-3\\
1&-2&1&3
\end{array}\right]\begin{array}{l}
R_3\\R_2\\R_1
\end{array}\nonumber\\
&\equiv
\left[\begin{array}{ccc|c}
2&0&0&3\\
0&-4&2&-3\\
0&-4&2&0
\end{array}\right]\begin{array}{l}
R_1\\R_1+2R_2\\R_2-R_3
\end{array}\nonumber\\
&\equiv
\left[\begin{array}{ccc|c}
2&0&0&3\\
0&-4&2&-3\\
0&0&0&-3
\end{array}\right]\begin{array}{l}
R_1\\R_2\\R_2-R_3
\end{array}\nonumber\\
&\equiv
\left[\begin{array}{ccc|c}
1&0&0&\frac{3}{2}\\
0&1&-\frac{1}{2}&\frac{3}{4}\\
0&0&0&-3
\end{array}\right]\begin{array}{l}
\frac{1}{2}R_1\\-\frac{1}{4}R_2\\R_3
\end{array}\label{eqa7}
\end{align}
\subsubsection{Part (c)}
From last row of the matrix in equation \eqref{eqa7}, we have $0x+0y+0z=-3\Rightarrow 0=-3$ which is not possible. Therefore there is no solution to the system of linear equations given in the question.
\subsubsection{Part (d)}
\begin{align}
x-2y+z&=3\label{eqa8}\\
-x-2y+z&=-3\label{eqa9}\\
2x&=3\label{eqa10}
\end{align}
Let's first find the line of intersection of the planes in equations \eqref{eqa8} and \eqref{eqa9}. By adding equations \eqref{eqa8} and \eqref{eqa9}, we have

\begin{equation}
-4y+2z=0\Rightarrow \fbox{$2y-z=0$}\label{eqa11}
\end{equation}
Let's now find the line of intersection of the planes in equations \eqref{eqa8} and \eqref{eqa10}. From equation \eqref{eqa10}, we know that $x=\frac{3}{2}$ and by substituting $x=\frac{3}{2}$ in equation \eqref{eqa8}, we have
\begin{equation}
\frac{3}{2}-2y+z=3\Rightarrow -2y+z=\frac{3}{2}\Rightarrow \fbox{$2y-z=-\frac{3}{2}$}\label{eqa12}
\end{equation}
Let's now find the line of intersection of the planes in equations \eqref{eqa9} and \eqref{eqa10}. From equation \eqref{eqa10}, we know that $x=\frac{3}{2}$ and by substituting $x=\frac{3}{2}$ in equation \eqref{eqa9}, we have
\begin{equation}
-\frac{3}{2}-2y+z=-3\Rightarrow -2y+z=-\frac{3}{2}\Rightarrow \fbox{$2y-z=\frac{3}{2}$}\label{eqa13}
\end{equation}
It is obvious that the lines in  equations \eqref{eqa11}, \eqref{eqa12} and \eqref{eqa13} are parallel since these three equations only contain $y$ and $z$ variables and the coefficients of $y$ and $z$ in all of these three equations is $2$ and $-1$ respectively. Therefore since these three lines are parallel to each other, then there is no solution to the linear system of equations given in the question and we have got the same result in last part of our solution to the question.









\section{Calculus}
\subsection{Question 3}
Let's first write the Properties of Limits theorem\footnote{We just write the property of limit theorems that we actually need and we do not write all of them.} here so that we can refer to it later.
\begin{center}
\begin{tikzpicture}
\node [thmbox] (box) {%
    \begin{minipage}[t!]{0.8\textwidth}
Let $f:A\subset\mathbb{R}^n\to\mathbb{R}^m$, $g:A\subset\mathbb{R}^n\to\mathbb{R}^m$, $\mathbf{x_0}$ be in $A$ or be a boundary point of $A$, $\mathbf{b}\in\mathbb{R}^m$ and $c\in\mathbb{R}$; then
\begin{enumerate}[(i)]
\item If $\lim_{\mathbf{x}\to\mathbf{x_0}}f(\mathbf{x})=\mathbf{b}$, then $\lim_{\mathbf{x}\to\mathbf{x_0}}cf(\mathbf{x})=c\mathbf{b}$, where $cf: A\to\mathbb{R}^m$ is defined by $\mathbf{x}\mapsto c\left(f(\mathbf{x})\right)$.
\item If $\lim_{\mathbf{x}\to\mathbf{x_0}}f(\mathbf{x})=\mathbf{b}_1$ and $\lim_{\mathbf{x}\to\mathbf{x_0}}g(\mathbf{x})=\mathbf{b}_2$, then $\lim_{\mathbf{x}\to\mathbf{x_0}}(f+g)(\mathbf{x})=\mathbf{b}_1+\mathbf{b}_2$, where $(f+g):A\to\mathbb{R}^m$ is defined by $\mathbf{x}\mapsto f(\mathbf{x})+g(\mathbf{x})$.
\end{enumerate}
    \end{minipage}
    };
\node[thmtitle] at (box.north) {Theorem: Properties of Limits};
\end{tikzpicture}
\end{center}
By the continuity theorem, if $P(x_0,y_0)\in\mathbb{R}^2$ is an arbitrary point, then $f$ is continuous everywhere on $\mathbb{R}^2$ if:
\begin{equation}
\lim_{(x,y)\to(x_0,y_0)}f(x,y)=f(x_0,y_0)\label{eqc1}
\end{equation}
Now we have to deal with three sets, Set $A$ (light gray shaded area) where $x-y>0$, set $B$ (the red line) where $x-y=0$ and set $C$ (yellow shaded area) where $x-y<0$ as in figure \ref{figcextra} as our point $P(x_0,y_0)$ may exist in any of these sets.
\begin{figure}[h]
\centering
\begin{pspicture}(-2,-2)(2,2)
\psaxes[labels=none,ticks=none]{<->}(0,0)(-2,-2)(2,2)
\pspolygon*[linecolor=yellow](-1.8,-1.8)(1.8,1.8)(-1.8,1.8)
\pspolygon*[linecolor=lightgray](-1.8,-1.8)(1.8,-1.8)(1.8,1.8)
\psplot[linecolor=red,linewidth=2pt]{-1.8}{1.8}{x}
\uput[-90](2,0){$x$}
\uput[-180](0,2){$y$}
\uput[-45](0,0){$0$}
\uput[-180](-1.8,-1.8){$x-y=0$}
\uput[0](1.8,1.8){Set $B$}
\uput[0](-1,1){Set $C$}
\uput[0](0.5,-1){Set $A$}
\end{pspicture}
\caption{Sets $A$, $B$ and $C$}\label{figcextra}
\end{figure}
\begin{itemize}
\item When $P(x_0,y_0)\in A$, we have (Using continuity theorem and part (i) of property of limits theorem):
\[\lim_{(x,y)\to(x_0,y_0)}7\cos (x-y)=7\cos(x_0-y_0)=f(x_0,y_0)=7\cos(x_0-y_0)\]
Therefore the given function is continuous in the set $A$.
\item When $P(x_0,y_0)\in C$, we have (Using continuity theorem and part (i) and (ii) of property of limits theorem as explained more in the note on the next page):
\[\lim_{(x,y)\to(x_0,y_0)}2x+ay+b=2x_0+ay_0+b=f(x_0,y_0)=2x_0+ay_0+b\]
Therefore the given function is continuous in the set $C$.
\item When $P(x_0,y_0)\in B$ ( when $y_0$ and $x_0$ are the same thing, i.e. $y_0=x_0$), we have
\begin{itemize}
\item When $x-y\geq0$, we have
\begin{align}
\lim_{(x,y)\to(x_0,x_0)}7\cos(x-y)&=7\cos (x_0-x_0)=7,\label{eqc2}&&\text{(part (i) of the above theorem)}\\
\intertext{\item When $x-y<0$, we have}
\lim_{(x,y)\to(x_0,x_0)}(2x+ay+b)&=(2+a)x_0+b.\label{eqc3}&&\text{(parts (i) and (ii) of the above theorem)}
\end{align}
\end{itemize}
\begin{center}
\begin{tikzpicture}
\node [notebox] (box){%
    \begin{minipage}{0.8\textwidth}
In equation \eqref{eqc3}, the limit of each of the components $2x$, $ay$ and $b$ of the expression $2x+ay+b$ as $(x,y)\to(x_0,x_0)$ by part (i) of the Properties of Limits theorem is respectively $2x_0$, $ax_0$ and $b$ and hence the limit of the expression $2x+ay+b$ as $(x,y)\to(x_0,x_0)$ is the sum of the limits of each of the components $2x$, $ay$ and $b$ as $(x,y)\to(x_0,x_0)$ by part (ii) of the Properties of Limits theorem.
    \end{minipage}
};
\node[notetitle, right=10pt] at (box.north west) {Note};
\end{tikzpicture}
\end{center}
Therefore by the  continuity theorem as stated in equation \eqref{eqc1} if $f$ is going to be continuous everywhere on $\mathbb{R}^2$, then it also needs to be continuous on Set $B$ as well, thus equations \eqref{eqc2} and \eqref{eqc3} should be equal:
\begin{equation}
(2+a)x_0+b=7\label{eqc4}
\end{equation}
By differentiating both sides of \eqref{eqc4} with respect to $x_0$, we have:
\begin{equation}
\frac{d}{dx_0}\left((2+a)x_0+b\right)=\frac{d}{dx_0}(7)\Rightarrow 2+a=0\Rightarrow \fbox{$a=-2$}\label{eqc5}
\end{equation}
By substituting equation \eqref{eqc5} into equation \eqref{eqc4}, we have
\begin{equation}
0+b=7\Rightarrow\fbox{$ b=7$}\label{eqc6}
\end{equation}
\end{itemize}
\subsection{Question 4}
\begin{figure}[h]
\centering
\begin{pspicture}(-3,-3)(3,3)
\psaxes[dx=2,dy=2]{<->}(0,0)(-3,-3)(3,3)
\psline[linewidth=2pt,linecolor=blue,fillstyle=hlines*,hatchwidth=0.1\pslinewidth,hatchsep=1\pslinewidth,hatchangle=0](0,2)(-2,0)(0,-2)(2,0)(0,2)
\uput[-90](3,0){$x$}
\uput[-180](0,3){$y$}
\uput[0](1,1){$x+y=1$}
\uput[-180](-1,-1){$x+y=-1$}
\uput[0](1,-1){$x-y=1$}
\uput[-180](-1,1){$x-y=-1$}
\end{pspicture}
\caption{The sketch of the set $A$}
\end{figure}
\begin{align*}
\text{Interior of }A&=\left\{(x,y)\in\mathbb{R}^2:-1<x+y<1\text{ and }-1<x-y<1\right\}\\
\text{Boundary of }A&=\left\{(x,y)\in\mathbb{R}^2:-1\leq x-y\leq1\text{ and }x+y=1,x+y=-1,\right.\\
&\qquad\left.-1\leq x+y\leq1\text{ and }x-y=1,x-y=-1\right\}
\end{align*}
$A$ is not open because the boundary points of $A$ is also contained in the set $A$, so for the boundary  point $(x_0,y_0)$ in the set $A$, no matter how small we make $r$, still some parts of $D_r(x_0,y_0)$ is contained within the set $A$ and some other parts of it are outside of the set $A$. This is illustrated in figure \ref{figc2}.
\begin{figure}[h]
\centering
\begin{pspicture}(-3,-3)(3,3)
\psaxes[dx=2,dy=2]{<->}(0,0)(-3,-3)(3,3)
\psline[linewidth=2pt,linecolor=blue,fillstyle=hlines*,hatchwidth=0.1\pslinewidth,hatchsep=1\pslinewidth,hatchangle=0](0,2)(-2,0)(0,-2)(2,0)(0,2)
\pscircle[linestyle=dashed](0.25,1.75){0.5}
\psdot[dotsize=5pt](0.25,1.75)
\uput[-90](3,0){$x$}
\uput[-180](0,3){$y$}
\uput[0](1,1){$x+y=1$}
\uput[-180](-1,-1){$x+y=-1$}
\uput[0](1,-1){$x-y=1$}
\uput[-180](-1,1){$x-y=-1$}
\uput[0](0.5,2.25){$D_r(x_0,y_0)$}
\rput(-1.25,2.5){\rnode{A}{\footnotesize$(x_0,y_0)$}}
\rput(0.25,1.75){\rnode{B}{}}
\nccurve[arrows=->,linecolor=red,nodesep=3pt,angleB=85,angleA=5]{A}{B}
\end{pspicture}
\caption{The figure demonstrates that $A$ is not open.}\label{figc2}
\end{figure}
$\overline{A}=A$ because
\begin{align*}
\overline{A}&=A\cup\text{boundary of }A\\
&=\left\{(x,y)\in\mathbb{R}^2:-1\leq x+y\leq1\text{ and }-1\leq x-y\leq1\right\}\\
&\qquad\cup\left\{(x,y)\in\mathbb{R}^2:-1\leq x-y\leq1\text{ and }x+y=1,x+y=-1,\right.\\
&\qquad\left.-1\leq x+y\leq1\text{ and }x-y=1,x-y=-1\right\}\\
&=\left\{(x,y)\in\mathbb{R}^2:-1\leq x+y\leq1\text{ and }-1\leq x-y\leq1\right\}\\
&=A
\end{align*}
\subsection{Question 5}
\subsubsection{Part (a)}
\begin{proof}
It is obvious that
\begin{align}
u^2&\leq u^2+v^2+w^2\label{eqc7}\\
\intertext{Similarly we have}
|u|&\leq \|(u,v,w)\|\label{eqc8}\\
|v|&\leq \|(u,v,w)\|\label{eqc9}\\
|w|&\leq \|(u,v,w)\|\label{eqc10}
\end{align}
By multiplying inequalities \eqref{eqc8}, \eqref{eqc9} and \eqref{eqc10}, we have
\begin{equation}
0\leq|uvw|\leq\|(u,v,w)\|^3\label{eqc11}
\end{equation}
By dividing both sides of inequality \eqref{eqc11} by $\|(u,v,w)\|^2$ provided $u^2+v^2+w^2\not=0$, we have
\begin{equation}
0\leq \frac{|uvw|}{u^2+v^2+w^2}\leq\|(u,v,w)\|\label{eqc12}
\end{equation}
Since $\lim_{(u,v,w)\to(0,0,0)}0=\lim_{(u,v,w)\to(0,0,0)}\|(u,v,w)\|=0$, then by Sandwich theorem 
\[\lim_{(u,v,w)\to(0,0,0)}\frac{|uvw|}{u^2+v^2+w^2}=0\]
Hence  $\lim_{(u,v,w)\to(0,0,0)}\frac{uvw}{u^2+v^2+w^2}=0$.
\end{proof}
\begin{proof}
From proof 1, we know that the given limit is $0$, so here we prove by the $\epsilon$-$\delta$ method that the given limit is $0$.

We are required to find a $\delta>0$ (generally depending on $\epsilon$) with the property that $0<\|(u,v,w)-(0,0,0)\|<\delta$ implies $\|\frac{uvw}{u^2+v^2+w^2}-0\|<\epsilon$.

Given $\epsilon>0$, choose $\delta=\epsilon$ from bottom calculation, then $0<\|(u,v,w)-(0,0,0)\|=\|(u,v,w)\|<\delta$ implies $\|\frac{uvw}{u^2+v^2+w^2}-0\|<\epsilon$.
\begin{align*}
\left\| \frac{uvw}{u^2+v^2+w^2}\right\|&<\epsilon\\
\Rightarrow\left\| \frac{uvw}{u^2+v^2+w^2}\right\|&\leq\|(u,v,w)\|<\delta=\epsilon\quad\text{(from inequality \eqref{eqc12})}
\end{align*}
\end{proof}
\subsubsection{Part (b)}
Let $f(s,t)=\frac{s-t}{s+t}$. Let's first approach $(0,0)$ along the $s$-axis, where $t=0$, so $f(s,0)=\frac{s}{s}=1$.
\[\therefore\lim_{(s,t)\to(0,0)}\frac{s-t}{s+t}=\lim_{(s,t)\to(0,0)}\frac{s}{s}=1\quad\text{(along the $s$-axis)}\]
Let's now approach $(0,0)$ along the $t$-axis, where $s=0$, so $f(0,t)=-\frac{t}{t}=-1$.
\[\therefore\lim_{(s,t)\to(0,0)}\frac{s-t}{s+t}=\lim_{(s,t)\to(0,0)}-\frac{t}{t}=-1\quad\text{(along the $t$-axis)}\]
Since we have obtained two different limits along two different paths, therefore the given limit does not exist.


%
%\begin{tikzpicture}
%\node [proofbox] (box){%
%    \begin{minipage}{0.8\textwidth}
%This is a proof. Given an $\epsilon>0$ we are required to find a $\delta>0$.
%    \end{minipage}
%};
%\node[prooftitle, right=10pt] at (box.north west) {Proof};
%\node[prooftitle, rounded corners] at (box.east) {\CheckmarkBold};
%\end{tikzpicture}%
%%
%\newpage
%\begin{tikzpicture}[transform shape, rotate=10, baseline=-3.5cm]
%\node [thmbox] (box) {%
%    \begin{minipage}[t!]{0.5\textwidth}
%    This is a theorem.
%    \end{minipage}
%    };
%\node[thmtitle] at (box.north) {Continuity Theorem};
%\end{tikzpicture}
\end{document}
